<?php
$page_title="Manage Program Members -";
include("includes/header.php");
$prg_id=$_REQUEST["prg_id"];
$mode=$_GET["mode"];
if($mode=="rem"){
qry_data("update bkitc_program_members set rec_status=0 where prg_mem_id=".$_REQUEST["prg_mem_id"]);
}
$prg_info=@array_pop(qry_data("select * from bkitc_programs where prg_id=".$prg_id));

$memberInfo=qry_data("SELECT M.*,P.* FROM bkitc_program_members P join  bkitc_profiles M on P.member_id=M.registrant_id where P.rec_status=1 and  P.program_id='".$prg_id."'");

?>
<div class="fleft">
<ul class="subMenu">

<li><a href="edit_prg.php?mode=edit&prg_id=<?=$prg_id?>">Back to Program Info</a></li>
</ul>
</div>
<div class="cleardiv"></div>
<div style="width:100%" class="content_bg">

<form method="post" action="edit_email_pro.php?gid=<?=$_GET["gid"]?>" enctype="multipart/form-data" onsubmit="return validateRegistration(this)">
<div>
Program Title :  <?=$prg_info["prg_title"]?><br/>
Program Date : <?=$prg_info["prg_date"]?><br/>
<hr/>
</div>
<table cellspacing="3" cellpadding="3">

<tr>
<td colspan="2">
<table   width="100%" class="table_panel" cellspacing="0" cellpadding="4">
<tr>
<? if(checkRole(SUPER_ADMIN) ) { ?>
<th  width="5"><input type="checkbox"  class="chk_all"   onclick="var chkState=this.checked;$$('.chk_item').each(function(vItem){vItem.checked=chkState;});"/></th>
<? } ?>
<th width="2">SNo</th>
<th width="5">Reg.Id</th>
<th>Name</th>

<th>Email</th>
<th>Skype Id</th>
<th style="width:10px">Mobile</th>
<th >Last Updated</th>
<th >Mem Status</th>
<th >Admin Status</th>
<th>Details </th>
<th>Remove </th>
</tr>
<? foreach($memberInfo as $i=>$member) {?>

<?$nofile=0;
 if(!file_exists("../images/photos/".$member["registrant_id"]."/".$member["photo_filename"])) $nofile=1;
if($member["photo_filename"]=="") $nofile=1;
 ?>

<tr <?if($i%2==0) echo 'class="white_bg"'; else echo 'class="grey_bg"' ?>>
<? if(checkRole(SUPER_ADMIN) ) { ?>
<td><input type="checkbox" class="chk_item" value="<?=$member["registrant_id"]?>"/></td>
<? } ?>
<td><?=$i+1;?></td>
<td><?=formatMemberCode($member["registrant_id"]);?></td>
<td><?=$member["full_name"];?></td>

<td><?=$member["email_id"];?></td>
<td><?=$member["reg_chat_id"];?></td>
<td><?=$member["mobile_no"];?></td>
<td><?=$member["admin_last_updated"]?></td>
<td><?=$prg_status[$member["prg_reg_status"]]?></td>
<td><?=$prg_final_status[$member["final_status"]]?></td>
<td><a href="edit_prg_mem.php?mode=edit&prgmem_id=<?=$member["prg_mem_id"]?>">Details</a> </td>
<td><a onclick="if(!confirm('Are you sure to remove this member from this program?')) return false;" href="prg_mem_list.php?mode=rem&prg_mem_id=<?=$member["prg_mem_id"]?>&prg_id=<?=$member["program_id"]?>">Remove</a> </td>
</tr>

<? } ?>
</table>

</td>


</tr>



</tbody>
</table>
<hr/>

</form>
</div>

<? include("includes/footer.php");?>